package br.com.datasun.biblioteca.ui.listeners;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class KeyListenerNumerosDecimais implements KeyListener {
	public void keyTyped(KeyEvent arg0) {
		char tecla = arg0.getKeyChar();
		boolean isVirgula = (',' == tecla);
		boolean isPonto   = ('.' == tecla);
		if(!(Character.isDigit(tecla)| (isPonto ))){
			arg0.consume(); //faz com que o evento seja ignorado
		}
	}
	public void keyReleased(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}
	public void keyPressed(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}
}
